package com.yuyou.fn.settlement.service;

import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.settlement.entity.ChangeRecord;
import com.yuyou.fn.settlement.entity.MainAccount;
import com.github.wens.framework.service.ISuperService;
import com.yuyou.fn.settlement.vo.AccountReportQueryVo;
import com.yuyou.fn.settlement.vo.ProfitDetailVo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 *
 * MainAccount 表数据服务层接口
 *
 */
public interface IMainAccountService extends ISuperService<MainAccount,Long> {


    List<MainAccount> findMainAccount(Long areaTeamId, Long busTeamId);

    Page<ChangeRecord> findAccountReportDetailList(AccountReportQueryVo accountReportQueryVo, int pageNo, int pageSize);

    ProfitDetailVo calProfit(Long  mainAccountId, Date startDate, Date endDate);

    BigDecimal sumAmountByQuery(AccountReportQueryVo accountReportQueryVo, boolean isPositive );

    BigDecimal sumNotSettleAmount(Long mainAccountId ,String subject , Date startDate, Date endDate);

    BigDecimal calBalance(MainAccount mainAccount, BigDecimal amount);

    void settleBalance(MainAccount mainAccount);

    void increaseBalance(Long mainAccountId, BigDecimal balance);

}